Polish propchange event detail names#116
Merged
Merged
Conversation
3 tasks
dda5b94 to
007399b
Compare
6deab19 to
ed6b090
Compare
007399b to
f5de09e
Compare
ed6b090 to
23ed648
Compare
f5de09e to
5648082
Compare
23ed648 to
a0e7afb
Compare
5648082 to
f0956e6
Compare
a0e7afb to
52aa111
Compare
LeaVerou
approved these changes
May 15, 2026
f0956e6 to
a02c7fa
Compare
52aa111 to
0366bc0
Compare
a02c7fa to
f0956e6
Compare
0366bc0 to
52aa111
Compare
f0956e6 to
78bc87a
Compare
52aa111 to
a3ed3b1
Compare
The re-fire previously dispatched a PropChangeEvent with no detail, so a listener that read e.detail.value would crash on the catch-up dispatch while succeeding on the regular dispatch. Populate a minimal detail with source: "initial" (marker for synthetic catch-up) and value (the field whose absence caused the crash). Found while integration-testing nude-element against color-elements (<space-picker value="oklab" onspacechange="…"> exercises this path).
`change.attributeValue ?? change.element.getAttribute(...)` treated an explicit null (callers signaling "clear this attribute") the same as "no override given, look it up on the element." When a reflected prop was set to null or undefined, the fallback re-read the existing attribute, so the clear never happened. Switch to `!== undefined` so `null` propagates to the subsequent `attributeValue === null` branch and removes the attribute. Fixes the "Clearing a reflected prop removes the attribute" regression tests for both `value: undefined` and `value: null`.
78bc87a to
b509235
Compare
Rename the `propchange` event detail fields to match the post-signals naming on `gitbutler/workspace` so consumers see a single, clearly named value pair: - `event.detail.parsedValue` → `event.detail.value` (now the parsed / converted value; the raw user-provided input is no longer in the detail) - `event.detail.oldInternalValue` → `event.detail.oldValue` - `event.detail.attributeName` is only set when an attribute is actually involved (was previously always present, sometimes undefined) Internal supporting changes: - `Prop#set` destructured param `oldValue` → `oldAttributeValue` so the new local `oldValue` (previous parsed value) doesn't shadow it - `Props#attributeChanged` caller updated to pass `oldAttributeValue: oldValue` - `src/plugins/events/onprops.js` consumer reads `change.value` / `change.oldValue` - One `test/plugins/props/propchange.js` consumer updated Baseline preserved: 91 pass / 7 fail / 4 skip — the 7 pre-existing regression pins are unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
a3ed3b1 to
e82d409
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rename
propchangeevent detail fields to matchmain:parsedValue→value(now the parsed/converted value; the raw input is no longer in the detail)oldInternalValue→oldValueattributeNameis only set when an attribute is actually involvedInternal:
Prop#setparamoldValue→oldAttributeValueto avoid shadowing the new local;onprops.jsand onepropchange.jstest follow the new names.Stacked on #115. Baseline preserved: 91 pass / 7 fail / 4 skip (same 7 pins).
🤖 Generated with Claude Code